// clang_c_test_01.cpp : Defines the entry point for the console application.
//

#pragma once
#include "stdafx.h"

//trying to get rid of warning in xutility
//#define _SCL_SECURE_NO_WARNINGS
//#pragma warning( disable : 4996 )

int wmain(int argc, _TCHAR* argv[])
{
 
	char* filename = "C:\\Users\\aasenjo\\Documents\\Visual Studio 2010\\Projects\\clang_c_test_01\\testPrograms\\toy\\toy01\\toy01.cpp";
//	char* filename = "C:\\dev\\breakpad\\src\\client\\windows\\handler\\exception_handler.cc";
//  char* filename = "C:\\Users\\aasenjo\\Documents\\Visual Studio 2010\\Projects\\VerySimple\\VerySimple\\B.cpp";
 //char* filename = "C:\\Users\\aasenjo\\Documents\\Visual Studio 2010\\Projects\\clang_c_test_01\\clang_c_test_01\\clang_c_test_01.cpp";

//   char* cliArgs = "";
   //Parse file
   //Create our AST
   AST::ASTree tree(std::string("testTree"));
 
   AST::Builder builder;
   builder.buildAST(filename,tree);

	//visualize tree
   tree.viewGraph();

   std::vector<std::string> names;
   tree.leafs(names);
   
   for (unsigned i=0;i<names.size();i++)
	   fprintf(stderr, "Leaf %d: %s\n", i, names[i].c_str());
   /*
   for (unsigned I = 0, N = clang_getNumDiagnostics(TU); I != N; ++I) {    
    CXDiagnostic Diag = clang_getDiagnostic(TU, I);
    CXString String = clang_formatDiagnostic(Diag, 
                               clang_defaultDiagnosticDisplayOptions());
    fprintf(stderr, "%s\n", clang_getCString(String));
    clang_disposeString(String);
	
	}*/

	return 0;
}



